<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>访问验证 - {{ app_name }}</title>
    <link href="/static/css/bootstrap.min.css" rel="stylesheet">
    <link href="/static/css/fontawesome.min.css" rel="stylesheet">
    <link href="/static/css/style.css" rel="stylesheet">
    <link rel="icon" href="/static/favicon.ico" type="image/x-icon">
    <style>
        body {
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
            min-height: 100vh;
            display: flex;
            align-items: center;
            justify-content: center;
        }
        .verify-container {
            background: white;
            border-radius: 15px;
            box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1);
            overflow: hidden;
            width: 100%;
            max-width: 400px;
        }
        .verify-header {
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
            color: white;
            padding: 30px;
            text-align: center;
        }
        .verify-body {
            padding: 40px 30px;
        }
        .form-floating {
            margin-bottom: 20px;
        }
        .btn-verify {
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
            border: none;
            padding: 12px;
            font-weight: 600;
            width: 100%;
        }
        .btn-verify:hover {
            background: linear-gradient(135deg, #5a6fd8 0%, #6a4190 100%);
        }
        .security-tips {
            background: #f8f9fa;
            border-left: 4px solid #007bff;
            padding: 15px;
            margin-top: 20px;
            border-radius: 5px;
        }
    </style>
</head>
<body>
    <div class="verify-container">
        <div class="verify-header">
            <h3><i class="fas fa-lock me-2"></i>{{ app_name }}</h3>
            <p class="mb-0">此分享内容受密码保护</p>
        </div>
        
        <div class="verify-body">
            {% if error %}
            <div class="alert alert-danger alert-dismissible fade show" role="alert">
                <i class="fas fa-exclamation-circle me-2"></i>{{ error }}
                <button type="button" class="btn-close" data-bs-dismiss="alert"></button>
            </div>
            {% endif %}
            
            <div class="alert alert-info border-0 mb-4">
                <div class="d-flex">
                    <div class="flex-shrink-0">
                        <i class="fas fa-info-circle"></i>
                    </div>
                    <div class="flex-grow-1 ms-3">
                        <small>
                            此分享内容需要访问密码才能查看。请输入分享者提供的访问密码。
                        </small>
                    </div>
                </div>
            </div>
            
            <form method="POST" action="/share/{{ share_token }}/verify">
                <div class="form-floating">
                    <input type="password" class="form-control" id="accessPassword" name="access_password" placeholder="访问密码" required>
                    <label for="accessPassword"><i class="fas fa-key me-2"></i>访问密码</label>
                </div>
                
                <button type="submit" class="btn btn-primary btn-verify">
                    <i class="fas fa-unlock me-2"></i>验证并访问
                </button>
            </form>
            
            <div class="security-tips">
                <h6 class="text-primary mb-2">
                    <i class="fas fa-shield-alt me-2"></i>安全提示
                </h6>
                <ul class="mb-0 small text-muted">
                    <li>请确保您在安全的环境中输入密码</li>
                    <li>访问密码由分享者设置和提供</li>
                    <li>如果忘记密码，请联系分享者</li>
                </ul>
            </div>
        </div>
        
        <div class="card-footer bg-light text-center">
            <small class="text-muted">
                <i class="fas fa-shield-alt me-1"></i>
                由 {{ company_name }} 安全分享
            </small>
        </div>
    </div>

    <script src="/static/js/jquery.min.js"></script>
    <script src="/static/js/bootstrap.bundle.min.js"></script>
    <script>
        $(document).ready(function() {
            // 自动聚焦到密码输入框
            $('#accessPassword').focus();
            
            // 回车键提交表单
            $('#accessPassword').on('keypress', function(e) {
                if (e.which === 13) {
                    $(this).closest('form').submit();
                }
            });
        });
    </script>
</body>
</html>